﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules
{
    /// <summary>
    /// 流程主信息
    ///</summary>
    [TableName("sys_flow")]
    [Description("流程信息主表")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true)]
    [Serializable]
    public class SysFlow : IDelEntity
    {
        /// <summary>
        /// 主键
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 流程编码
        ///</summary>
        [Column("code")]
        public string Code { get; set; }

        /// <summary>
        /// 流程名称
        ///</summary>
        [Column("name")]
        public string Name { get; set; }

        /// <summary>
        /// 是否删除
        ///</summary>
        [Column("is_deleted")]
        public bool IsDeleted { get; set; } = false;

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        [Ignore]
        bool IDelEntity.IsDeletedInDatabase { get => IsDeleted; set => IsDeleted = value; }

        #endregion IEntity 成员
    }
}